#include <ctime>
#include <iostream>
#include <fstream>

using namespace std;
void bubbleSort(int list[], int listLength){
     while (listLength--){
            bool swapped = false;

     for(int i = 0; i < listLength; i++) {
            if(list[i] > list[i + 1]){
                    swap(list[i], list[i + 1]);
            swapped = true;
            }
     }
     if(swapped == false) break;
}
}

void read(const char*filename, int a[], int length) {
    ifstream file(filename);
    for(int i=0; i < length; i++)
        file >> a[i];
}
int main ()
{
    #define LEN 5000
    int a [LEN] ;

    read("ml sorted txt", a, LEN) ;
    unsigned int t_start = clock()
    bsort(a, LEN) ;
    unsigned int t_finish = clock();
    unsigned int t work = t finish - t_start;
    cout<<"ml_sorted " << t_work << " milliseconds \n";

    read("m2_reverse",a, LEN) ;
    t_start = clock():
    bsort(a, LEN) ;
    t_finish = clock0::
    t_work = t_finish - t start;
    cout<<"m2 reverse " << t_work << " milliseconds \n";

    read("m3_shuffle",a, LEN)
    t_start = clock();
    bubbleSort (a, LEN) ;
    t_finish = clock();
    t_work = t finish - t_start:
    cout<<"m3_shuffle " << t_work << " milliseconds \n";
return 0;
